Skip to content

Conversation

@alejandro-colomar
Copy link
Collaborator

@alejandro-colomar alejandro-colomar commented Dec 12, 2025

This removes some conditional compilation.


Revisions:

v1b
  • Rebase
$ git rd 
1:  894a0df85 = 1:  90376b56c configure.ac, lib/utmp.c: Assume ut_host is supported
2:  3b95148a7 = 2:  53415c808 configure.ac, lib/utmp.c: Assume ut_name is not supported
v1c
  • Rebase
$ git rd 
1:  90376b56c = 1:  ea3e27d96 configure.ac, lib/utmp.c: Assume ut_host is supported
2:  53415c808 = 2:  92eeb29fc configure.ac, lib/utmp.c: Assume ut_name is not supported

Every system we care about has ut_host.

	alx@devuan:~/src/musl/libc/master$ grepc -tt utmpx . \
					| grep -e '^[.}]' -e ut_host
	./include/utmpx.h:struct utmpx {
		char ut_host[256];
	};
	alx@devuan:~/src/musl/libc/master$ cd ../../../bsd/freebsd/main/
	alx@devuan:~/src/bsd/freebsd/main$ grepc -tt utmpx . \
					| grep -e '^[.}]' -e ut_host
	./include/utmpx.h:struct utmpx {
		char		ut_host[128];	/* Remote hostname. */
		char		__ut_host[128];
	};
	./lib/libc/gen/getutxent.3:struct utmpx {
		char            ut_host[];  /* Remote hostname. */
	};
	alx@devuan:~/src/bsd/freebsd/main$ cd ../../netbsd/trunk/
	alx@devuan:~/src/bsd/netbsd/trunk$ grepc -tt utmpx . \
					| grep -e '^[.}]' -e ut_host
	./include/utmpx.h:struct utmpx {
		char ut_host[_UTX_HOSTSIZE];	/* host name */
	};
	./lib/libc/gen/endutxent.3:struct utmpx {
		char ut_host[_UTX_HOSTSIZE];    /* host name */
	};
	alx@devuan:~/src/bsd/netbsd/trunk$ cd ../../openbsd/master/
	alx@devuan:~/src/bsd/openbsd/master$ grepc -tt utmpx . \
					| grep -e '^[.}]' -e ut_host
	alx@devuan:~/src/bsd/openbsd/master$ grepc -tt utmp . \
					| grep -e '^[.}]' -e ut_host
	./include/utmp.h:struct utmp {
		char	ut_host[UT_HOSTSIZE];
	};
	./share/man/man5/utmp.5:struct utmp {
		char    ut_host[UT_HOSTSIZE];
	};
	alx@devuan:~/src/bsd/openbsd/master$ cd ../../../gnu/glibc/master/
	alx@devuan:~/src/gnu/glibc/master$ grepc -tt utmpx . \
					| grep -e '^[.}]' -e ut_host
	./sysdeps/gnu/bits/utmpx.h:struct utmpx
	  char ut_host[__UT_HOSTSIZE]
	};
	./sysdeps/unix/sysv/linux/s390/bits/utmpx.h:struct utmpx
	  char ut_host[__UT_HOSTSIZE]
	};

Signed-off-by: Alejandro Colomar <alx@kernel.org>
ut_name and ut_user can't coexist.  We already assume ut_user is
supported.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Simpler A good issue for a new beginner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant